<template>
  <el-tabs v-model="activeName" stretch @tab-click="handleClick(activeName)">
    <el-tab-pane v-for="(item,index) of label" :key="index" :label="item" :name="index==0?'first':'second'">
      <slot :name="index" />
    </el-tab-pane>
  </el-tabs>
</template>

<script>
export default {
  name: "Index",
  props: ['label'],
  data() {
    return {
      activeName: 'first',
    };
  },
  methods: {
    handleClick(name, tab, event) {
      this.$emit('cheackTabs', name);
    },
  },
};
</script>

<style scoped lang="scss">
/deep/.el-tabs__header.is-top {
  width: 34%;
  margin-left: 33%;
}

/deep/.el-tabs__nav-wrap.is-top:after {
  width: 0 !important;
}
</style>
